package com.cy.model;

import com.cy.BasicModel;
import com.cy.ext.plugin.tablebind.TableBind;

@TableBind(tableName="user_map_company", pkName = "user_id")
public class UserMapCompany extends BasicModel<UserMapCompany> {
    public static final UserMapCompany dao = new UserMapCompany();
    public static final String SELECT_ALL = "`user_id`,`company_id`";

    public UserMapCompany findByUser(Long userId){
        return findFirst("SELECT * FROM user_map_company WHERE user_id = ?", userId);
    }
            
    public UserMapCompany setUserId(Long userId){
        return this.set("user_id",userId);
    }

    public Long getUserId(){
        return this.get("user_id");
    }
        
    public UserMapCompany setCompanyId(Long companyId){
        return this.set("company_id", companyId);
    }

    public Long getCompanyId(){
        return this.get("company_id");
    }
}